<?php echo $header; ?>
<div class="page">
	<div class="personal_info">
    	Welcome,<span id="userName"><?php echo $this->customer->getLastName() ?></span>
					<a href="index.php?route=account/logout">logout</a>
    </div>
	<div class="greenPanel">
		<table width="95%" cellpadding="0" cellspacing="0" align="center" style="margin:auto;">
			<tr>
				<td colspan="3" align="left" height="50px">
					<a href="javascript:void(0)" style="float:left;background:url(catalog/view/theme/default/images/agreeItem.png);padding:8px 70px 17px 62px;">Account</a>
				</td>
			</tr>
			<tr>
				<?php echo $left; ?>
				<td style="height:500px;" valign="top" class="ManageMain">
					<ul>
						<li>My Points</li>
					</ul>
					<p><?php echo $text_total; ?><b> <?php echo $total; ?></b>.</p>
					<br>
					<table width="380" cellpadding="0" cellspacing="0" class="list" style="display: table">
						<tr>
                      <th width="20%">Date Added</th>
                      <th width="50%">Description</th>
                      <th width="20%">Points</th>
                    </tr>
						<?php if ($rewards) { ?>
						<?php foreach ($rewards  as $reward) { ?>
						<tr>
							<td class="left"><?php echo $reward['date_added']; ?></td>
							<td class="left"><?php if ($reward['order_id']) { ?>
								<a href="<?php echo $reward['href']; ?>"><?php echo $reward['description']; ?></a>
								<?php } else { ?>
								<?php echo $reward['description']; ?>
								<?php } ?>
							</td>
							<td class="right"><?php echo $reward['points']; ?></td>
						</tr>
						<?php } ?>
						<?php } else { ?>
						<tr>
						<td class="center" colspan="5"><?php echo $text_empty; ?></td>
						</tr>
						<?php } ?>
					</table>
				</td>
			</tr>
		</table>
	</div>
</div>
<?php echo $footer; ?>